﻿using PoemGame.Domain.GameAggregate;
using PoemGame.Domain.Services.Duishi;
using PoemGame.Domain.Services.Feihualing;
using PoemGame.Domain.Services.Jielong;
using PoemService.Shared;

namespace PoemGame.Domain.Services.Factory.Simple
{
    public class CheckAnswerServiceFactory : IDomainServiceFactory<ICheckAnswerService>
    {
        private readonly IPoemService poemService;
        public CheckAnswerServiceFactory(IPoemService _poemService)
        {
            poemService = _poemService;
        }

        public ICheckAnswerService GetService(GameType gamePlayType)
        {
            switch (gamePlayType.MainType)
            {
                case "Duishi":
                    return new DuishiCheckAnswerService(poemService);
                case "Feihualing":
                    return new FeihualingCheckAnswerService(poemService);
                case "Jielong":
                    return new JielongCheckAnswerService(poemService);
            }
            return null;
        }
    }
}